package com.maila.xiaoaoschool.util;

import android.app.Activity;
import android.content.Context;
import android.util.DisplayMetrics;

public class DpTransformationUtil {

    private static final DisplayMetrics dm = new DisplayMetrics();


    public static int dipToPx(Context mContext, int dip) {
        ((Activity) mContext).getWindowManager().getDefaultDisplay().getMetrics(dm);
        return (int) (dip * dm.density + 0.5f);
    }
}
